#pragma once
#include <iostream>
#include <string>
#include <functional>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <sys/wait.h>
#include <memory>
#include <thread>

#include "Log.hpp"
#include "InterAddr.hpp"
#include "Dict.hpp"
#include "mypthread.hpp"
#include "ThreadPool.hpp"


enum ERR
{
    OK = 0,
    CALL_ERR,
    SOCK_ERR,
    CONNECT_ERR,
    BIND_ERR,
    LISTEN_ERR,
    FORK_ERR
};

class NoCopy
{
public:
NoCopy(){}
virtual ~NoCopy(){}
NoCopy(const NoCopy& copy) = delete;
const NoCopy& operator = (const NoCopy& copy) = delete;
};

// 宏定义的类型转换 type conversion
#define CONV(addr) ((struct sockaddr *)addr)